#ifndef CNPIPE_SINGLEELEMENT_H
#define CNPIPE_SINGLEELEMENT_H

#include <QDebug>
#include <QObject>
#include <QString>

/**
 * 单一单元
 * @brief The CNPIPE_singleElement class
 */
class CNPIPE_singleElement : public QObject
{
public:
    CNPIPE_singleElement(QString element, QString node1, QString node2,
                         QString type, QString mat, double angle) {
        this->element = element; //单元号
        this->node1 = node1; //起始节点号
        this->node2 = node2; //终止节点号
        this->type = type; //单元的种类
        this->mat = mat; //材料名称
        this->angle = angle; //角度
    }
    virtual QString getElementName() {
        return element;
    }
    virtual QString getNode1() {
        return node1;
    }
    virtual QString getNode2() {
        return node2;
    }
    //Any type starting with 'E' is bended.
    virtual bool isBended() {
        bool returnBool = type.at(0) == 'E';
        if (returnBool) {
            qDebug() << "Bended pipe: " << type;
        }
        return returnBool;
    }
private:
    QString element; QString node1; QString node2;
    QString type; QString mat; double angle;
};

#endif // CNPIPE_SINGLEELEMENT_H
